package cn.tedu.mvc;


import org.junit.Test;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

@RestController
@RequestMapping("get")
public class GetController {
    @RequestMapping("param")
    public String param(int id,String name){
        return "您的请求参数id="+id+" name="+name;
    }
    @RequestMapping("param3")
    public String param3(int id,String name,String height){
        return "您请求的参数id="+id+" name="+name+" height"+height;
    }
    @RequestMapping("param4")
//    public String param4(int id,String name,String type,String color,double price){
    public Car param4(Car car){
        return car;
    }

//    @Test
//    public void geti(){
//        String url = "http://localhost:8080/car/insert?id=1&name=张三&aeg=18";
//        String[] s1 = url.split("\\?");
//        String[] s2 = s1[1].split("&");
//        for (String s:s2
//             ) {
//            String[] s3 = s.split("=");
//            System.out.println(Arrays.toString(s3));
//        }
//    }
}
